// build a number guessing game in ReScript

module Main = {
  // generate random number between 1 and 100
  let randomNumber = Random.nextInt(1, 100)
  // print the random number
  printfn("Random number is: " ++ toString)(randomNumber)
  // print the guess
  printfn("Enter your guess: ")
  // read the guess
  let guess = readln()
  // print the guess
  printfn("Your guess is: " ++ toString(guess))
  // check if the guess is correct
  if guess == randomNumber {
    print("Correct!")
  } else {
    print("Incorrect!")
  }
}
